<template>
  <div class="home clearfix">
    <div class="a" v-charts:[loading]="a" />
    <button @click="setCCC">123456</button>
  </div>
</template>

<script>
import { charts } from "@/directives";
import { setInterval } from "timers";
import { CCC } from "@/plugs/fjs";
let a = 10;
export default {
  name: "home",
  data() {
    return {
      a: {
        title: {
          text: "ECharts 入门示例"
        },
        tooltip: {},
        xAxis: {
          data: ["衬衫", "羊毛衫", "雪纺衫", "裤子", "高跟鞋", "袜子"]
        },
        yAxis: {},
        series: [
          {
            name: "销量",
            type: "bar",
            data: [5, 20, 36, 10, 10, 20]
          }
        ]
      },
      loading: "loading"
    };
  },
  mounted() {
    const { $set, loading } = this;
    // setInterval(() => {
    //   $set(this, "loading", this.loading === "loading" ? "" : "loading");
    // }, 1000);
  },
  methods: {
    setCCC() {
      const { $el } = this;
      const el = document.createElement('div');
      $el.appendChild(el);
      const t = CCC(a++, el);
      console.log(t);
    }
  },
  directives: {
    charts
  }
};
</script>
<style lang="scss" scoped>
@import "./index.scss";
</style>
